package com.hehao.controller;

import com.hehao.service.TimeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.format.DateTimeFormatter;
@RestController
@RequestMapping("/demo")
public class IndexController {
    @DubboReference
    private TimeService timeService;


    @GetMapping("/time")
    public String getTime() {
        return timeService.getTime().format(DateTimeFormatter.ISO_LOCAL_TIME);
    }
}